<template>
  <div class="custom_cell_container">
    <i class="iconfont custom_cell_icon" :class="icon"></i>
    <div class="custom_cell_content" :class="border ? 'custom_cell_content_border' : ''">
      <div class="custom_cell_content_left">
        {{ text }}
      </div>
      <div class="custom_cell_content_right">
        <slot name="right"></slot>
      </div>
    </div>
  </div>
</template>

<script type="text/babel">
  export default {
    name: 'CustomCell',
    props: {
      icon: String,
      text: String,
      border: {
        type: Boolean,
        default: true
      }
    }
  };
</script>

<style scoped lang="less">
  .custom_cell_container {
    display: flex;
    align-items: center;
    width: 100%;
    .custom_cell_icon {
      flex: 0 0 auto;
      color: #999;
      font-size: 32px;
      margin: 0 30px;
    }
    .custom_cell_content {
      display: flex;
      align-items: center;
      flex: 1 0 auto;
      padding: 20px 0;
      border-bottom: 1px solid transparent;
      .custom_cell_content_left {
        flex: 1 0 auto;
        text-align: left;
        color: #333;
        font-size: 32px;
      }
      .custom_cell_content_right {
        flex: 0 0 auto;
        margin-right: 30px;
        text-align: right;
        color: #999;
        font-size: 28px;
      }
    }
    .custom_cell_content_border {
      border-bottom: 1px solid #e1e1e1;
    }
  }
</style>